#ifndef __STORAGE_H__
#define __STORAGE_H__

#include "fw/vbb_Queue.h"
#include "fw/vbb_USART.h"
#include "fw/vbb_Flash.h"

typedef struct
{    
    // Network Settings
    char    HTTPServerAddr[32];
    char    HTTPServerPort[8];
    
    char    HTTPServerAddr2[32];
    char    HTTPServerPort2[8];
    
    int     MessagePerHour_Move;
    int     MessagePerHour_Idle;    
    int     ServerMessagePerHour;
    
    // Information
    char    OwnerId[32];
    char    VehicleId[32];
    char    VehicleModel[32];
    char    DeviceModel[32];
    char    PlateNumber[32]; 
    char    FirmwareDir[128];
    char    FirmwarePrefix[32];
    char    DriverName[128];
    char    VIN[128];
    
    // BGTVT
    int     WarningVelocity;
    
    //Sensor
    bool    ActiveOnHigh_Door;
    bool    ActiveOnHigh_Engine;
    bool    ActiveOnHigh_AC;
    
    bool    HTTP_ProtocolEnable;
        
    int     PulseOnKm;    
    bool    OfflineMode;        
} VBB_Config;

typedef struct
{    
    VBB_Flash flash;    
    VBB_Config config;    
    char tmpmsg[MESSAGE_SIZE];    
} VBB_Storage;

void vbb_STORAGE_Init(void);
void vbb_STORAGE_ReadConfig(void);
void vbb_STORAGE_AddConfig(const char * ConfigLine);
bool vbb_STORAGE_CheckConfig(const char * ConfigLine);
void vbb_STORAGE_Clear(void);

#endif

